package initialize

import (
	"template/server/http/docs"
	"template/server/http/pkg/server/router"

	"github.com/gin-gonic/gin"
	swaggerfiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)

func Router() *gin.Engine {
	r := gin.Default()
	docs.SwaggerInfo.BasePath = "/api"
	ApiRouterGroup := r.Group("/api")
	ApiV1RouterGroup := router.V1Router{}
	ApiV1RouterGroup.InitV1RouterGroup(ApiRouterGroup)
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
	return r
}
